package cn.hy.visit;

public class App {


    public static void main(String[] args) {

        // visit 由 访问者来定义具体的实现逻辑
        LevelOneMember oneMember = new LevelOneMember();
        LevelTowMember towMember = new LevelTowMember();
        LevelThreeMember threeMember = new LevelThreeMember();

        // element
        FruitMilkTea fruitMilkTea1 = new FruitMilkTea(10);
        FruitMilkTea fruitMilkTea2 = new FruitMilkTea(15);
        FruitMilkTea fruitMilkTea3 = new FruitMilkTea(18);
        PearMilkTea pearMilkTea1 = new PearMilkTea(20);
        PearMilkTea pearMilkTea2 = new PearMilkTea(25);

        // element manage  provide add remove and accept
        MilkTeaShop  shop = new MilkTeaShop();
        shop.add(fruitMilkTea1);
        shop.add(fruitMilkTea2);
        shop.add(fruitMilkTea3);
        shop.add(pearMilkTea1);
        shop.add(pearMilkTea2);

        // 访问者 前来访问 我管理的元素
        shop.accept(oneMember);
        shop.accept(towMember);
        shop.accept(threeMember);

    }
}
